<template>
    <section>
        <sy-baselist
                ref="main"
                :autoSearch="true"
                fixOperate
                :filters="filters"
                @beforeAdd="beforeAdd"
                editVue="./customer/Contacts_Edit.vue"
                listUrl="server/customer/Contacts.ashx?cmd=GetList"
                deleteUrl="server/customer/Contacts.ashx?cmd=Delete"
        >
            <el-table-column prop="FName" label="姓名" width="80" >
            </el-table-column>
            <el-table-column prop="FSex" label="性别" width="80" >
            </el-table-column>
            <el-table-column prop="FAge" label="年龄" width="80" >
            </el-table-column>
            <el-table-column prop="FOriginPlace" label="籍贯" width="120" >
            </el-table-column>
            <el-table-column prop="FPosition" label="职位" width="80" >
            </el-table-column>
            <el-table-column prop="FDept" label="部门" width="80" >
            </el-table-column>
            <el-table-column prop="FForProject" label="分管事务" width="120" >
            </el-table-column>
            <el-table-column prop="FPhone" label="手机" width="150" >
            </el-table-column>
            <el-table-column prop="FTelphone" label="固定电话" width="150" >
            </el-table-column>
            <el-table-column prop="FFax" label="传真" width="150" >
            </el-table-column>
            <el-table-column prop="FEmail" label="邮箱" width="200" >
            </el-table-column>
            <el-table-column prop="FQQ" label="QQ" width="120" >
            </el-table-column>
            <el-table-column prop="FWx" label="微信" width="120" >
            </el-table-column>
            <el-table-column prop="FNote"  header-align="center" label="备注" width="250" >
            </el-table-column>
            <template  scope="props" slot="extendbtn">
                <div style="padding: 5px">  </div>
            </template>
            <template  scope="props" slot="extendbtn_end">
                <div style="padding: 5px">  </div>
            </template>
        </sy-baselist>
    </section>
</template>

<script>
    import util from '../../common/util'
    export default {
        data(){
            return {
                custID:0,
                filters: [
                    {type: "string",name:"FName",text:"姓名"},
                    {type: "string",name:"FPhone",text:"手机"},
                    {type: "string",name:"FTelphone",text:"固定电话"}
                ]
            }
        },
        methods:{
            _init(custID){
               this.custID = custID
               this.$refs.main._search("1=1","FCustID="+custID)
            },
            beforeAdd(row,r){
               if(!this.custID){
                   //return r.error = "请选择客户";
               }
               row.FCustID = this.custID
            }
        }
    }
</script>